Skip to content

feat(learning): add local decision runtime - #274

Closed
alliscode wants to merge 9 commits into
mainfrom
alliscode-local-learning-runtime
Closed

alliscode wants to merge 9 commits into
mainfrom
alliscode-local-learning-runtime

Conversation

@alliscode

@alliscode alliscode commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Why

Teams need a safe way to exercise the decision-model lifecycle locally before connecting real training infrastructure. This adds a customer-operated reference that proves jobs, evaluation, promotion, rollback, persistence, and authenticated inference without requiring a GPU or model download.

What changes

The brand-check package gains a local runtime with bounded asynchronous jobs, immutable candidates and evaluation reports, append-only promotion generations, explicit rollback, restart recovery, liveness and readiness endpoints, and an authenticated scoring contract.

A deterministic fixture backend and demo exercise the complete lifecycle. Fixture candidates are marked development/test-only and cannot be promoted, restored, reported ready, or served in production. A small backend interface leaves real-model integration for a later change.

The runtime also includes a dependency-free container image and focused coverage for persistence, exclusive state ownership, candidate integrity, wall-time limits, production gating, request validation, authentication, failure recovery, promotion, rollback, and clean shutdown.

This pull request is stacked on #203.

@alliscode
alliscode requested review from a team and nshki as code owners November 17, 2026 16:07
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 16:07
@alliscode
alliscode added this pull request to stack #275 November 17, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical runtime and HTTP defects allow jobs to exceed deadlines, interrupted promotion writes to prevent restart, and unauthenticated connections to exhaust server resources.

15 open issues
What changed in this PR

Adds a customer-operated local decision-model runtime to the learning package, extending #203’s taskset and evaluation work while keeping training and serving outside Hub.

Changes:

  • Tracks asynchronous jobs, immutable candidates, evaluation reports, promotion, rollback, and restart recovery.
  • Adds authenticated scoring, health endpoints, and a deterministic fixture backend with production restrictions.
  • Includes a standalone container, lifecycle demo, runtime tests, and operator documentation.
File Description
packages/​learning/​README.md Introduces and links to the local runtime.
packages/​learning/​environments/​brand-check/​tests/​test_runtime.py Covers lifecycle, persistence, authentication, and production restrictions.
packages/​learning/​environments/​brand-check/​server/​runtime.Dockerfile Packages the runtime in a non-root container.
packages/​learning/​environments/​brand-check/​runtime.py Implements jobs, candidate storage, promotion, rollback, and inference.
packages/​learning/​environments/​brand-check/​runtime_server.py Exposes authenticated runtime routes and health endpoints.
packages/​learning/​environments/​brand-check/​README.md Documents operation, deployment, backend integration, and trust boundaries.
packages/​learning/​environments/​brand-check/​pyproject.toml Registers the runtime command.
packages/​learning/​environments/​brand-check/​examples/​runtime_demo.py Demonstrates the complete fixture lifecycle.
packages/​learning/​environments/​brand-check/​__init__.py Adds lazy exports for runtime classes.
docs/​adr/​0002-decision-model-and-rl-environment.md Describes the local reference runtime and its limits.

Review effort: Max (adaptive)

@alliscode
alliscode force-pushed the alliscode-local-learning-runtime branch from 63954a1 to 3703c13 Compare November 17, 2026 17:58
@alliscode
alliscode force-pushed the alliscode-local-learning-runtime branch from 3703c13 to 3180e63 Compare November 17, 2026 22:02
Base automatically changed from feat/learnings-decision-model to main November 17, 2026 23:25
Ben Thomas and others added 5 commits November 17, 2026 15:25
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode force-pushed the alliscode-local-learning-runtime branch from 3180e63 to 82a6568 Compare November 17, 2026 23:25
@alliscode
alliscode requested an adaptive review from Copilot November 17, 2026 23:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical defects let timed-out training continue, allow state writes after ownership is released, apply failed promotions after restart, and permit slow header reads to exhaust request capacity.

6 open issues
15 resolved since last review

Review effort: Max (adaptive)

Ben Thomas and others added 4 commits November 17, 2026 15:56
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode

Copy link
Copy Markdown
Contributor Author

Superseded by a corrected decision-model stack targeting build/hub/new. This PR remains as the reviewed legacy-main implementation history; its host-neutral runtime work will be replayed above the new-Hub decision package port.

@alliscode alliscode closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants